package com.cratos.xxgram.platf.message;

import com.cratos.xxgram.platf.base.BaseEntity;
import javax.persistence.*;
import org.redkale.convert.json.*;
import org.redkale.util.Comment;

/**
 *
 * @author SquRab
 */
@Table(comment = "app端会话置顶")
public class CvsationstickyRecord extends BaseEntity {

    @Id
    @Column(comment = "发送方 +'-' + 接收方 +'-' + 时间36 时间戳")
    private String cvsationstickyid;

    @Column(comment = "建立会话用户id")
    private int userid;

    @Column(updatable = false, comment = "创建时间")
    private long createtime;

    @Comment("10 新增  20 删除")
    @Transient
    private short optype;
    
    @Column(comment = "会话类型 10 普通用户 20 群")
    private short targettype;
    
    @Comment("10 普通用户")
    public static final short TARGET_TYPE_USER = 10;
    
    @Comment("20 群")
    public static final short TARGET_TYPE_GROUP = 20;
    
    
    @Comment("10 新增")
    public static final short OP_SAVE = 10;
    
    @Comment("20 删除")
    public static final short OP_REMOVE = 20;

    public short getTargettype() {
        return targettype;
    }

    public void setTargettype(short targettype) {
        this.targettype = targettype;
    }
    
    public short getOptype() {
        return optype;
    }

    public void setOptype(short optype) {
        this.optype = optype;
    }

    public void setUserid(int userid) {
        this.userid = userid;
    }

    public int getUserid() {
        return this.userid;
    }

    public void setCreatetime(long createtime) {
        this.createtime = createtime;
    }

    public long getCreatetime() {
        return this.createtime;
    }

    public String getCvsationstickyid() {
        return cvsationstickyid;
    }

    public void setCvsationstickyid(String cvsationstickyid) {
        this.cvsationstickyid = cvsationstickyid;
    }

    
    @Override
    public String toString() {
        return JsonConvert.root().convertTo(this);
    }
}
